package com.godyao.config;

import com.godyao.interceptors.LimitRateInterceptor;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author godyao
 * @date 2022/3/25
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
    @Autowired
    private LimitRateInterceptor limitRateInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(limitRateInterceptor).addPathPatterns("/**");
    }
}
